package net.gxnun.xiaoyuan.core.message.handler.impl;

import net.gxnun.xiaoyuan.core.message.handler.MessageHandler;
import net.gxnun.xiaoyuan.core.message.request.RequestMsg;
import net.gxnun.xiaoyuan.core.message.response.ResponseModel;
import net.gxnun.xiaoyuan.core.message.response.ResponseTextMsg;
import net.gxnun.xiaoyuan.core.share.MsgType;

import org.springframework.stereotype.Component;

/**
 * 错误目录处理器
 * @author yesheng
 *
 */
@Component
public class MenuErrorMessageHandler implements MessageHandler{

    private String errorMessage = "您输入有误！";
    
    @Override
    public ResponseModel handler(RequestMsg msg) {
        ResponseTextMsg rmsg = new ResponseTextMsg();
        rmsg.setContent(errorMessage);
        rmsg.setCreateTime(System.currentTimeMillis()+"");
        rmsg.setFromUserName(msg.getToUserName());
        rmsg.setFuncFlag("");
        rmsg.setMsgType(MsgType.Text);
        rmsg.setToUserName(msg.getFromUserName());
        ResponseModel model = new ResponseModel();
        model.setValue(rmsg);
        return model;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

}
